package com.fastCms.business.frame.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fastCms.business.frame.constant.CommonConst;
import com.fastCms.business.frame.pojo.entity.CloudMenu;
import com.fastCms.business.frame.daos.CloudMenuMapper;
import com.fastCms.business.frame.service.CloudMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 平台菜单表 服务实现类
 * </p>
 *
 * @author liusq
 * @since 2019-05-27
 */
@Service
public class CloudMenuServiceImpl extends ServiceImpl<CloudMenuMapper, CloudMenu> implements CloudMenuService {

    @Override
    public List<CloudMenu> findByOrganizeCode(String organizeCode, String functionType) {
        QueryWrapper<CloudMenu> cloudMenuQueryWrapper = new QueryWrapper<>();
        cloudMenuQueryWrapper.eq("state", CommonConst.STATE.VALID);
        cloudMenuQueryWrapper.eq("organize_code", organizeCode);
        cloudMenuQueryWrapper.eq("function_type", functionType);
        return this.list(cloudMenuQueryWrapper);
    }
}
